holybible.view.VersesView = holybible.view.ListView.extend({
	LIST_TEMPLATE: "<ol class='text'></ol>",
	ITEM_TEMPLATE: "<li>${text}</li>",
	name: "verses",
	
	init: function() {
		this._super();
		this.model = holybible.model.Verse.getInstance();
		this.vcode = null;
		this.bcode = null;
		this.cnum = null;
	},
	show: function(params) {
		var vcode = params.vcode || null;
		var bcode = params.bcode || null;
		var cnum = params.cnum || null;
		if (!vcode || !bcode || !cnum) {
			return;
		}

		this._super(params);
		
		if (this.vcode != vcode || this.bcode != bcode || this.cnum != cnum) {
			this.clearList();
			this.draw(params);
		}
	},
	draw: function(params) {
		var vcode = params.vcode || null;
		var bcode = params.bcode || null;
		var cnum = params.cnum || null;
		if (!vcode || !bcode || !cnum) {
			return;
		}

		this._super(params);
		
		this.vcode = vcode;
		this.bcode = bcode;
		this.cnum = cnum;
		var list = this.model.getList(vcode, bcode, cnum) || [];
		for(var i = 0 ; i < list.length ; i++) {
			var item = $(this.makeHtml(this.ITEM_TEMPLATE, {
				text: list[i]
			}));
			this.addList(item);
		}
	}
});